﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using InSilicio.Scene;
using System.IO;

namespace InSilicio.Render.Renderers
{
    /// <summary>
    /// An abstract base class for all renderer types (e.g. basic renderers and photon mappers).
    /// </summary>
    public abstract class BaseRenderer
    {
        /// <summary>
        /// The width of the image to be rendered.
        /// </summary>
        protected readonly int imgWidth;
        /// <summary>
        /// The height of the image to be rendered.
        /// </summary>
        protected readonly int imgHeight;
        /// <summary>
        /// The image being rendered.
        /// </summary>
        protected Bitmap image;
        /// <summary>
        /// The 3D representation of the scene that will be rendered.
        /// </summary>
        protected PartyScene scene;

        /// <summary>
        /// Constructor to be utilized via subclasses.
        /// </summary>
        /// <param name="imgWidth">The width of the image to be rendered.</param>
        /// <param name="imgHeight">The height of the image to be rendered.</param>
        protected BaseRenderer(int imgWidth, int imgHeight)
        {
            this.imgWidth = imgWidth;
            this.imgHeight = imgHeight;
            this.image = new Bitmap(imgWidth, imgHeight);
        }

        /// <summary>
        /// Renders the loaded scene to an image.
        /// </summary>
        /// <returns>The rendered image.</returns>
        public abstract Bitmap Render();
    }
}
